package com.tempjob.common.model;

import com.anwen.mongo.annotation.collection.CollectionField;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * @author hui
 * @Date 2024/11/7 22:09
 **/
@Data
@ApiModel
@NoArgsConstructor
@AllArgsConstructor
public class WorkDayModel {

    @ApiModelProperty("日期")
    private String day;

    @ApiModelProperty("人数")
    private Integer workerNum;

    @ApiModelProperty("已招到人数")
    private Integer workerNumRecruited;

    @ApiModelProperty("还需要人数")
    @CollectionField(exist = false)
    private Integer needNum;

    @ApiModelProperty("申请状态")
    @CollectionField(exist = false)
    private Integer applyStatus;

    public Integer getNeedNum() {
        needNum = workerNum - (workerNumRecruited == null ? 0 : workerNumRecruited);
        return needNum;
    }

    public Integer getApplyStatus() {
        if (applyStatus == null) {
            return 0;
        }
        return applyStatus;
    }
}
